package com.ashok.mvc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ashok.dao.UserDao;
import com.ashok.domain.User;

@Controller
@RequestMapping(value="/dao")
public class TestController {
	
	@Autowired
	private UserDao userDao;
	@RequestMapping(value="show")
	public String getUser(ModelMap model){
		
		User username = userDao.getUser("ashok", "admin");
		
		System.out.println("User Name : "+username);
		model.addAttribute("name", username);
		return "show";
	}
}
